package demo.thread;

/**
 * @author liuteng
 * @date 2017/8/25 15:59
 */
public class JoinTest implements Runnable {

    public static int a = 0;

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            a = a + 1;
        }
    }

    public static void main(String[] args) throws InterruptedException {
        Runnable runnable = new JoinTest();
        Thread thread = new Thread(runnable);
        thread.start();
        thread.join();
//        thread.sleep(3000);
        System.out.println(a);
    }
}
